<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title>学生管理页面</title>
    <link href="/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="/Public/admin/css/base.css" media="all">
    <link rel="stylesheet" href="__STATIC__/iconpicker/css/icon-picker.css">
    <link rel="stylesheet" type="text/css" href="/Public/admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/Public/admin/css/style.css" media="all">
    <script type="text/javascript" src="/Public/admin/js/jquery.js"></script>

    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <style type="text/css">
        body {
            padding: 10px 0 0 10px
        }
    </style>
</head>

<body>
    <!-- 标题栏 -->
    <div class="main-title">
        <h2><?php echo ($meta_title); ?></h2>
    </div>
    <div class="cf">
        <div class="fl">
            <a class="btn" href="<?php echo U('edit');?>">新 增</a>
            <a class="btn" href="<?php echo U('School/index');?>">学校列表</a>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <input type="text" class="text search-text" name="search_name" value="<?php echo ($search_name); ?>" placeholder="搜索姓名">&nbsp;
            <a class="me-btn" id="search" data-url="<?php echo U('');?>">搜索</a>
        </div>

    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped" style="margin: 30px;">
        <table>
            <thead>
                <tr>
                    <th>ID</th>
                    <th>所属学校</th>
                    <th>照片</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>爱好</th>
                    <th>入学时间</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <?php if(!empty($list['list'])): if(is_array($list['list'])): $i = 0; $__LIST__ = $list['list'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($vo["id"]); ?> </td>
                            <td><strong><?php echo ($vo["school_id"]); ?></strong></td>
                            <td>
                                <?php if(!empty($vo['head_img'])): if(is_array($vo['head_img'])): foreach($vo['head_img'] as $key=>$vimg): ?><img src="<?php echo ($vimg); ?>" width="150px" style="border: 2px solid black; border-radius: 5px;"><?php endforeach; endif; endif; ?>
                            </td>
                            <td> <strong> <?php echo ($vo["name"]); ?> </strong>
                            </td>
                            <td><strong><?php echo ($vo["sex"]); ?></strong></td>
                            <td><?php echo ($vo["hobby"]); ?></td>
                            <td><?php echo ($vo["admission_time"]); ?></td>
                            <td><?php echo (date("Y-m-d H:i",$vo["create_time"])); ?></td>
                            <td>
                                <a title="修改" href="<?php echo U('edit',array('id'=>$vo['id']));?>">修改</a>
                                <a title="删除" class="ajax-get confirm" href="<?php echo U('setStatus',array('ids'=>$vo['id'],'status'=>-1));?>">删除</a>
                            </td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    <?php else: ?>
                    <td colspan="15" class="text-center"> aOh! 暂时还没有内容! </td><?php endif; ?>
            </tbody>
        </table>
    </div>
    <div class="page">
        <?php echo ($list['page']); ?>
    </div>
</body>
<script type="text/javascript" charset="utf-8">
    //搜索功能
    $("#search").click(function() {
        var url = $(this).attr('data-url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });
    //回车搜索
    $(".search-text").keyup(function(e) {
        if (e.keyCode === 13) {
            $("#search").click();
            return false;
        }
    });
</script>

</html>